package org.example.zuoye.controller;


import jakarta.servlet.http.HttpServletRequest;
import org.example.zuoye.service.SchedulesService;
import org.example.zuoye.vo.SchedulesByDay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

/**
 * @Author xinchen
 * @Date: 2024/08/18/ 16:42
 * @Description
 */
@Controller
@RequestMapping("/client")
public class IndexController {

    @Autowired
    private HttpServletRequest request;
    /**
     * 医生放号信息
     */
    @Autowired
    private SchedulesService schedulesService;


    @GetMapping("/index")
    public String index() {
        return "client/index";
    }

    @GetMapping("/list")
    public String list(Map<String, Object> model) {
        //从数据库中获取今天所以的医生放号信息
        List<SchedulesByDay> schedulesList = this.schedulesService.findToday();
        model.put("schedule", schedulesList);
        return "client/list";
    }



    @GetMapping("/message")
    public String message() {
        return "client/message";
    }

    @GetMapping("/my")
    public String my() {
        return "client/my";
    }

}
